bug fix concerning sending mails