fix a crash when finish a game