correct query update references