fixed email function and validated

fixed email function and validated