modified wait_for_move