check if game over before making move