Use Path.get instead of Path.isValid