         case .scrollToPercentage(let verticalOffsetPercentage):
             scrollRestorationState = .none
             webView.scrollView.verticalOffsetPercentage = verticalOffsetPercentage
-        case .scrollToAnchor(let anchor, let attempt, let maxAttempts):
+        case .scrollToAnchor(let anchor, let attempt, let maxAttempts, let completion):
             scrollRestorationState = .none
             self.scroll(to: anchor, animated: true) { [weak self] (success) in
                 guard !success, attempt < maxAttempts else {
+                    completion?()
                     return
                 }
-                self?.scrollRestorationState = .scrollToAnchor(anchor, attempt: attempt + 1, maxAttempts: maxAttempts)
+                completion?()
+                self?.scrollRestorationState = .scrollToAnchor(anchor, attempt: attempt + 1, maxAttempts: maxAttempts, completion: completion)
             }
         }
     }

                self?.setWebViewHidden(false, animated: true)
            })
        } else if let fragment = article.viewedFragment {
            scrollRestorationState = .scrollToAnchor(fragment)
        }
    }
    

            scrollRestorationState = .none
            self.scroll(to: CGPoint(x: 0, y: offset), animated: animated) { [weak self] (success) in
                guard !success, attempt < maxAttempts else {
                    completion?()
                    return
                }
                completion?()
