fix allergy handling code