add email validation and show error messages when validation failed