Fixed issue in case of non existing dir.