removing node and path caches to avoid memory leaks