end game bug fix