Add code to store dbs and also added better querygrp node control