add some methods to scanner