 
     // MARK: Properties
 
-    private let scene: MessagesScene
+    private weak var scene: MessagesScene?
     private let authenticationService: AuthenticationService
     private let privateMessagesService: PrivateMessagesService
     private let dateFormatter: DateFormatterProtocol

        presentedMessages = messages

        let binder = MessageBinder(messages: messages, dateFormatter: dateFormatter)
        scene.bindMessages(count: messages.count, with: binder)

        if messages.isEmpty {
            scene.hideMessagesList()
            scene.showNoMessagesPlaceholder()
        } else {
            scene.showMessagesList()
            scene.hideNoMessagesPlaceholder()
        }
    }


    }

    func messagesSceneDidTapLogoutButton() {
        delegate.showLogoutAlert { [weak self] (dismissAlert) in
            self?.authenticationService.logout { (result) in
                dismissAlert()

                switch result {
                case .success:
                    self?.delegate.messagesModuleDidRequestDismissal()

                case .failure:
                    self?.delegate.showLogoutFailedAlert()
                }
            }
        }
