Fix array bug for attachments