fix query error messages