Fixed bugs for QueryData