fixed issues with attachments