fixed bug around mkdirs usages