sleeping in main loop