   // MARK: - Background/Foreground reconnect strategy
   //----------------------------------------------------------------------
   private func observeDidBecomeActive() {
-      //Make sure there's no other observations
-      self.removeAppActiveObservation()
-      
-      self.didbecomeActiveObservervation = NotificationCenter.default
-        .addObserver(forName: UIApplication.didBecomeActiveNotification,
-                     object: nil,
-                     queue: .main) { [weak self] _ in self?.connectToConversation() }
-      
-      // When the app resigns being active, the leave any existing channels
-      // and disconnect from the websocket.
-      self.willResignActiveObservervation = NotificationCenter.default
-        .addObserver(forName: UIApplication.willResignActiveNotification,
-                     object: nil,
-                     queue: .main) { [weak self] _ in self?.disconnectFromChannel() }
+    //Make sure there's no other observations
+    self.removeAppActiveObservation()
+    
+    self.didbecomeActiveObservervation = NotificationCenter.default
+      .addObserver(forName: UIApplication.didBecomeActiveNotification,
+                   object: nil,
+                   queue: .main) { [weak self] _ in self?.connectToChat() }
+    
+    // When the app resigns being active, the leave any existing channels
+    // and disconnect from the websocket.
+    self.willResignActiveObservervation = NotificationCenter.default
+      .addObserver(forName: UIApplication.willResignActiveNotification,
+                   object: nil,
+                   queue: .main) { [weak self] _ in self?.disconnectFromChat() }
   }
   
   private func removeAppActiveObservation() {
-      if let observer = self.didbecomeActiveObservervation {
-        NotificationCenter.default.removeObserver(observer)
-        self.didbecomeActiveObservervation = nil
-      }
-      
-      if let observer = self.willResignActiveObservervation {
-        NotificationCenter.default.removeObserver(observer)
-        self.willResignActiveObservervation = nil
-      }
+    if let observer = self.didbecomeActiveObservervation {
+      NotificationCenter.default.removeObserver(observer)
+      self.didbecomeActiveObservervation = nil
+    }
+    
+    if let observer = self.willResignActiveObservervation {
+      NotificationCenter.default.removeObserver(observer)
+      self.willResignActiveObservervation = nil
+    }
   }
   
   private func connectToChat() {

      .subscribe( onNext: { (message) in
        let payload = message.payload
        guard
            let name = payload["name"] as? String,
            let message = payload["message"] as? String else { return }
        
        let shout = Shout(name: name, message: message)
        self.shouts.append(shout)

  
  // MARK: - Attributes
  private let username: String = "ChatRoom"
  //  private let socket = Socket("https://phxchat.herokuapp.com/socket/websocket")
  private let socket = Socket(endPoint: "https://phxchat.herokuapp.com/socket/websocket", transport: { url in return StarscreamTransport(url: url) })
  private let topic: String = "room:lobby"
  
