dir.exist also seems to not work as expected