fixed bug in attachments