     #
     # return a {string}
     getQueryKey: (str = '') ->
+        filter = _getFilter()
         filterize = (key) ->
-            filter[key] unless _isFilterEmpty key
+            filter[key] if _isFilter filter[key]
 
         keys = _.compact ['before', 'after'].map filterize
         keys.unshift str unless _.isEmpty str

            encodeURIComponent _getURISort()

        url = "mailbox/#{mailboxID}/?sort=#{sort}"
        if filter.type is 'flag' and _isFilterEmpty 'value', filter
            url += "&flag=#{filter.value}"

        if _isFilterEmpty 'before', filter
            url += "&before=#{encodeURIComponent filter.before}"

        if _isFilterEmpty 'after', filter
            url += "&after=#{encodeURIComponent filter.after}"
        return url


                result[key] = value
        result

    _isFilter = (value) ->
        value and value isnt '-'

    _getURISort = (filter) ->
        filter = _getFilter() unless filter
