add main thread sleeping every cycle of main loop