fix bugs in queryHash