added queryState