Updated team users function