update scan function