Fixed bugs on runQuery page