email function changes