Use undocumented withTimeout() instead of sleeping