Added caching for nodes and looking for queries in discovered nodes also