bug fixes for parsing team_id query