remove a thread.sleep in order to use a timeout