use routing in the query too

This was omitted from the last PR.