fixup query operation