wait time out function