         }
       }
       
-      attempt()
-      return serialDisposable
+      attempt?()
+      return BlockDisposable {
+        serialDisposable.dispose()
+        attempt = nil
+      }
     }
   }
   

          case .Failure(let error):
            if count > 0 {
              count--
              attempt()
            } else {
              observer.failure(error)
            }

    return create { observer in
      let serialDisposable = SerialDisposable(otherDisposable: nil)
      
      var attempt: (() -> Void)?

      attempt = {
        serialDisposable.otherDisposable?.dispose()
        serialDisposable.otherDisposable = self.observe(on: nil) { event in
