fix bug with downloading attachments