fix query to use new api