fixed end of game workflow