add error handling on mailer