added validation to check for email duplication