avoid crashing at game end