Trying to correctly update all scanned records. Currently, only updates first one.