fix bug when attachments is not available