fix time_wait