fix issue with 0 attachments