sleep for main thread