Replace the loop is by as and it will solve the problem....