Fix creating directory bug