               @loadMessage switchTo
             else
               @unselectMessage()
+            @updateMessagesCount()
 
           error: ->
             alert "Error while removing message."

          type: "DELETE"
          success: =>
            @unselectMessage()
          error: ->
            alert "Error while clearing all messages."


      .append($("<td/>").text(message.subject or "No subject").toggleClass("blank", !message.subject))
      .append($("<td/>").text(@formatDate(message.created_at)))
      .prependTo($("#messages tbody"))
    @updateMessagesCount()

  scrollToRow: (row) ->
    relativePosition = row.offset().top - $("#messages").offset().top
