sleep in the while loop