more fixes in the mailer functions