         }
         
         _lock.performLocked {
-            if !isDone {
-                removeKey = _group.insert(d)
-                isAdded = true
+            switch scheduleState {
+            case .added:
+                rxFatalError("Invalid state")
+                break
+            case .initial:
+                if let removeKey = _group.insert(d) {
+                    scheduleState = .added(removeKey)
+                }
+                else {
+                    scheduleState = .done
+                }
+                break
+            case .done:
+                break
             }
         }
     }

            }
            
            let action = self._lock.calculateLocked { () -> Action? in
                if isAdded {
                    self._group.remove(for: removeKey!)
                }
                else {
                    isDone = true
                }
                
                return self._action
            }
            

            }
            
            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
            }
            
