Adding query leaves and pair object