     }
     
     @discardableResult public func registerFinally<X>(block: @escaping () -> X) -> Promise<X> {
-        let p = Promise<X> { [weak self] resolve, reject, progress in
-            if let state = self?.state {
-                switch state {
-                case .fulfilled:
-                    resolve(block())
-                case .rejected:
-                    resolve(block())
-                case .pending:
-                    self?.failBlocks.append({ e in
-                        resolve(block())
-                    })
-                    self?.successBlocks.append({ t in
-                        resolve(block())
-                    })
-                }
-            }
-            self?.progressBlocks.append(progress)
-        }
+        let p = Promise<X>()
+        switch state {
+        case .fulfilled:
+            p.resolvePromise(block())
+        case .rejected:
+            p.resolvePromise(block())
+        case .pending:
+            failBlocks.append({ e in
+                p.resolvePromise(block())
+            })
+            successBlocks.append({ t in
+                 p.resolvePromise(block())
+            })
+        }
+        progressBlocks.append(p.progressPromise)
         p.start()
         passAlongFirstPromiseStartFunctionAndStateTo(p)
         return p

    }
    
    public func registerProgress(_ block: @escaping (Float) -> Void) -> Promise<Void> {
        let p = Promise<Void> { [weak self] resolve, reject, progress in
            if let state = self?.state {
                switch state {
                case .fulfilled:
                    resolve()
                case let .rejected(error):
                    reject(error)
                case .pending:()
                self?.failBlocks.append(reject)
                self?.successBlocks.append({ _ in
                    resolve()
                })
                }
            }
            self?.progressBlocks.append({ p in
                block(p)
                progress(p)
            })
        }
        p.start()
        passAlongFirstPromiseStartFunctionAndStateTo(p)
        return p

    }
    
    @discardableResult public func registerThen<X>(_ block: @escaping (T) -> X) -> Promise<X> {
        let p = Promise<X>()
        switch state {
        case let .fulfilled(value):
            let x: X = block(value)
            p.resolvePromise(x)
        case let .rejected(error):
            p.rejectPromise(error)
        case .pending:
            successBlocks.append({ t in
                p.resolvePromise(block(t))
            })
            failBlocks.append(p.rejectPromise)
            progressBlocks.append(p.progressPromise)
        }
        p.start()
        passAlongFirstPromiseStartFunctionAndStateTo(p)
