clean function deletes attachment