yeah, but it also fails when the path is a file path, and we need to distinguish both cases