framework to run query