support new style queries

Change-Id: I7ab12d9ee0227b2aedac4c072dbfb43fd15aa49b