Fixed bug in teams controller