a minor bug fix of scan