fix args positioning and add check before dir creation