Update teams_count only when needed