     }
 
     visitingCallback?(url)
-    task.resume()
+    currentTask?.resume()
   }
 
   func parse(document: String, url: Foundation.URL) {

  let visitingCallback: ((URL) -> Void)?
  let wordFoundCallback: (URL) -> Void
  let completion: (Int) -> Void

  public init(
    startURL: URL,

  func visit(page url: Foundation.URL) {
    visitedPages.insert(url)

    currentTask = URLSession.shared.dataTask(with: url) { [weak self] data, _, _ in
      defer { self?.crawl() }
      guard
        let data = data,
