Fix directory bug