Revert "change the wait method to regular sleep()"

This reverts commit 99842d0156b7feba09a10324ab6acd70d4115524.