fixed infinite loop for sleeping