made the mailer thread safe