Added query stack