         return states.count + reducers.count + observers.count
     }
 
-    func add<S: State>(state: S) -> Any {
+  func add<S: State>(state: S) -> Any {
         let box = StateBox(state: state)
-        work.sync {
-            weakStates.append { [weak box] in box }
-        }
+        weakStates.append { [weak box] in box }
         var effects: [Effect] = []
         observers.forEach { observer in
             effects += send { try observer.apply(state: state) }

    
    func add<S: State, A: Action>(reducer: @escaping Reducer<S, A>) -> Any {
        let box = ReducerBox(reducer: reducer)
        work.sync {
            weakReducers.append { [weak box] in box }
        }
        return box
    }
    

    
    func add(middleware: Middleware) -> Any {
        let box = middleware.box
        weakMiddlewares.append { [weak box] in box }
        return box
    }
    
    func subscribe<S: State>(priority: Priority = .normal, observer: @escaping Observer<S>) -> Any {
        let box = ObserverBox(priority: priority, observer: observer)
        weakObservers.append { [weak box] in box }
        var effects: [Effect] = []
        states.forEach { state in
            effects += send { try state.apply(observer: observer) }
