patch to avoid crash on missing dir from path