Final query update