fix overflow of multiple attachments