manage query