fix queryObj fn