implement query_op