set game end before calling onWin