fixed timedwait