 
   addMessage: (message) =>
     messageView = new MessageItemView model: message
-    @$el.append messageView.render().$el
+    @$el.append messageView.render().el
 
   scrollToBottom: ->
     @$el.scrollTop @$el.prop 'scrollHeight'

    @$el.html @template()
    @conversationListView = new ConversationListView
      collection: new Conversations
    @conversationListView.collection.fetch()
    @conversationListView.$el = @.$('.conversations')
    this

class Router extends Backbone.Router

      beforeSend: (xhr) ->
        xhr.setRequestHeader 'X-CSRFToken', data.csrfmiddlewaretoken
      success: =>
        @.$('textarea') .val ''
        @messageListView.collection.add message
        @messageListView.scrollToBottom()

