fix changed behaviour of (timed)wait