changed check for null teams