fixed error when refreshing page in the middle of a game