finish query