         //  close session
         mxSession?.close()
         
-        guard let content = originalContent else {
+        guard let content = originalContents[eventId] else {
             NSLog("[NotificationService] fallbackToOriginalContent: Original content is missing.")
             return
         }

    }
    
    func processEvent(_ event: MXEvent) {
        guard let content = originalContent, let mxSession = mxSession else {
            self.fallbackToOriginalContent(forEventId: event.eventId)
            return
        }


class NotificationService: UNNotificationServiceExtension {
    
    /// Content handlers. Keys are eventId's
    var contentHandlers: [String: ((UNNotificationContent) -> Void)] = [:]
    
    /// Original contents. Keys are eventId's
    var originalContents: [String: UNMutableNotificationContent] = [:]
    
    var cachedEvent: MXEvent?
    var mxSession: MXSession?
