Handle the end of game