Fixed end of game bug