improve directory deletion