finish query model