fix directory deletion error