Add sleep in while loop