             else
                 val1 = message1[criteria]
                 val2 = message2[criteria]
-            if val1 > val2 then return -1 * _sortOrder
-            else if val1 < val2 then return 1 * _sortOrder
+            if val1 > val2 then return -1 * order
+            else if val1 < val2 then return 1 * order
             else return 0
 
-    __sortFunction = __getSortFunction 'date'
+    __sortFunction = __getSortFunction 'date', 1
 
     # Creates an OrderedMap of messages
     _messages = Immutable.Sequence()

    getMessagesByMailbox: (mailboxID) ->
        sequence = _messages.filter (message) ->
            return mailboxID in Object.keys message.get 'mailboxIDs'
        .sort(__getSortFunction _sortField)

        ###
        if _filter isnt MessageFilter.ALL

    _sortOrder   = 1
    _filter      = '-'
    _quickFilter = ''
    __getSortFunction = (criteria, order) ->
        sortFunction = (message1, message2) ->
            if typeof message1.get is 'function'
                val1 = message1.get criteria
