fixed bug in sendMail