Correction of email not sending bug