fixed exit() so it writes the winningTeams relation