Adding query engine