fixed end game bug