     public func event(withEventId eventId: String,
                       inRoom roomId: String,
                       completion: @escaping (MXResponse<MXEvent>) -> Void) {
-        Queues.processingQueue.async {
+        processingQueue.async {
             self._event(withEventId: eventId, inRoom: roomId, completion: completion)
         }
     }

                
                if let event = self.syncResponseStore.event(withEventId: eventId, inRoom: roomId), !self.canDecryptEvent(event) {
                    //  we got the event but not the keys to decrypt it. continue to sync
                    Queues.processingQueue.async {
                        self.launchBackgroundSync(forEventId: eventId, roomId: roomId, completion: completion)
                    }
                } else {
                    //  do not allow to sync anymore
                    Queues.processingQueue.async {
                        self._event(withEventId: eventId, inRoom: roomId, allowSync: false, completion: completion)
                    }
                }
            case .failure(let error):
                guard let _ = self else {

    /// Initializer
    /// - Parameter credentials: account credentials
    public init(withCredentials credentials: MXCredentials) {
        processingQueue = DispatchQueue(label: "MXBackgroundSyncServiceQueue-" + MXTools.generateSecret())
        self.credentials = credentials
        syncResponseStore = MXSyncResponseFileStore()
        syncResponseStore.open(withCredentials: credentials)
        restClient = MXRestClient(credentials: credentials, unrecognizedCertificateHandler: nil)
        restClient.completionQueue = processingQueue
        store = MXBackgroundStore(withCredentials: credentials)
        store.open(with: credentials, onComplete: nil, failure: nil)
        if MXRealmCryptoStore.hasData(for: credentials) {
