modify thread_sleep()