improved robustness for non-existing directories