fixed isLastTeam method