Fixed team end bug