             var subscribers = self.subscribers[identifier] ?? []
             let weakSubscriber = WeakSubscriber(subscriber as AnyObject)
             subscribers.insert(weakSubscriber)
-            self.subscribers[identifier] = subscribers
-            self.cleanup(eventType)
+            self.subscribers[identifier] = Set(subscribers.filter { $0.inner is T })
         }
     }
 

                fatalError("Expected class, found struct/enum: \(subscriber)")
            }
            let identifier = ObjectIdentifier(eventType)
            let weakSubscriber = WeakSubscriber(subscriber as AnyObject)
            let _ = self.subscribers[identifier]?.remove(weakSubscriber)
            self.cleanup(eventType)
        }
    }


            }
        }
    }
}
