added try/except check on closing attachments index file