fix directory bug