Fix waiting routine