Fixing directory bug