fix game end bug