adapt to scanner api change.