fix sending email bug