fix bug when game end