if (progress) {
      progress.scanned += 1
      if (result) {
        progress.valid += 1
      } else {