switch to thread sleep
new version