wait until takes an input of the timeout