fix processing of multiple attachments with same name