Add close on delete for dist classes