fix directory not exist bug