fix errors in sending email