Fixed an error in email sending