need to fix team loop