working doQuery