check that the argument is a valid path