             markSectionTabActive(activeSection)
 
         $scope.$watch "searchTerm", (searchTerm) ->
-            $location.search("text", searchTerm) if searchTerm?
+            $location.search("text", searchTerm) if searchTerm
 
         $el.on "click", ".search-filter li > a", (event) ->
             event.preventDefault()

        # linkFilters($scope, $el, $attrs, $ctrl)
        linkTable($scope, $el, $attrs, $ctrl)

        $scope.$watch "projectId", (projectId) ->
            $scope.searchTerm = $routeparams.text if projectId?

    return {link:link}


## Search box directive
#############################################################################

SearchBoxDirective = ($lightboxService, $navurls, $location, $route)->
    link = ($scope, $el, $attrs) ->
        project = null

