fix multiple attachments upload bug