fix bug for missing attachments array