apply query to rootscope