finish query port