fixed post deletion bug when attachments exist