check if node is in path