change allergy.name to allergy.allergen.name, was passing with names undefined so put check for that