update scan.cpp