Added function to remove invalid emails.