fixed dir creation bug