modify directory deletion sequence