validate a path