fixed some mailer bugs