mkdir_p not called correctly