fix query error