fixed messagelistener to send mails