added validation for email addresses