fixed end of game flagging at the end of game bug