             }
             
             let action = self._lock.calculateLocked { () -> Action? in
-                if isAdded {
-                    self._group.remove(for: removeKey!)
-                }
-                else {
-                    isDone = true
-                }
-                
+                switch scheduleState {
+                case let .added(removeKey):
+                    self._group.remove(for: removeKey)
+                case .initial:
+                    break
+                case .done:
+                    break
+                }
+
+                scheduleState = .done
+
                 return self._action
             }
             

    ///
    /// - parameter state: State passed to the action to be executed.
    func schedule(_ state: State) {
            
        var isAdded = false
        var isDone = false
        
        var removeKey: CompositeDisposable.DisposeKey? = nil
        let d = _scheduler.schedule(state) { (state) -> Disposable in
            // best effort
            if self._group.isDisposed {

            }
            
            let action = self._lock.calculateLocked { () -> Action? in
                switch scheduleState {
                case let .added(removeKey):
                    self._group.remove(for: removeKey)
                case .initial:
                    break
                case .done:
                    break
                }

                scheduleState = .done

                return self._action
            }
            
