fixed bug with some mails being sent without attachment