trivial change to store correct query strings for different agents
updated to Yifan's version of the code