change the way of loop