refactored mkdir -p calls to use mkdir_p to get better diagnostics in log if dir creation fails - eg user-rights