modified ccd dir creation code