Remove sleep, replace with event wait.