Fix sub directory bug