Fixing Query Tool