Update to add new query for range