refactor; fixed crash when game mode is started and stopped