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

  render: =>
    @$el.html @template
    @messageListView = new MessageListView collection: @model.messages
    @messageListView.$el = @.$('.messages')
    @messageListView.render()
    @messageListView.scrollToBottom()
    this


  addMessage: (message) =>
    messageView = new MessageItemView model: message
    @$el.append messageView.render().el

  scrollToBottom: ->
    @$el.scrollTop @$el.prop 'scrollHeight'
