fixed error in scan