fix flaw in path resolution