fix querystate regression