             $el.find(".search-result-table").html(element)
 
         $scope.$watch "searchResults", (data) ->
-            lastSeatchResults = data
-
-            return if !lastSeatchResults
+            lastSearchResults = data
+
+            return if !lastSearchResults
 
             activeSection = getActiveSection(data)
 

        applyAutoTab = true
        activeSectionName = "userstories"
        tabsDom = $el.find("section.search-filter")
        lastSeatchResults = null

        getActiveSection = (data) ->
            maxVal = 0

            target = angular.element(event.currentTarget)

            sectionName = target.parent().data("name")
            sectionData = if !lastSearchResults then [] else lastSearchResults[sectionName]

            section = {
                name: sectionName,
