Fixed a bug in sending email