       }
       channels = newChannels
     }
-    
+
     public func send(data: Phoenix.Payload) {
       if isConnected() {
         doSendBuffer(data)

import Starscream

public struct Phoenix {
  
  // MARK: Phoenix Message
  public class Message: Serializable {
    var subject: String?
    var body: AnyObject?
    public var message: AnyObject?
    
    public init(subject: String, body: AnyObject) {
      (self.subject, self.body) = (subject, body)
      super.init()
      create()
    }
    
    public init(message: AnyObject) {
      self.message = message
      super.init()
      create(false)
    }
    
    func create(single: Bool = true) -> [String: AnyObject] {
      if single {
        return [self.subject!: self.body!]

        }
      }
    }

    func send(event: String, message: Phoenix.Message) {
      print("conn sending")
      let payload = Phoenix.Payload(topic: topic!, event: event, message: message)
      socket?.send(payload)
    }

    public func leave(message: Phoenix.Message) {
      if let sock = socket {
        sock.leave(topic: topic!, message: message)
