created email validation function.