change the function for email exception