         # linkFilters($scope, $el, $attrs, $ctrl)
         linkTable($scope, $el, $attrs, $ctrl)
 
+        searchText = $routeparams.text
         $scope.$watch "projectId", (projectId) ->
-            $scope.searchTerm = $routeparams.text if projectId?
+            $scope.searchTerm =  searchText if projectId?
 
     return {link:link}
 

            $scope.$apply ->
                $location.path(url)
                $location.search("text",text).path(url)

        $scope.$on "search-box:show", (ctx, newProject)->
            project = newProject
            $lightboxService.open($el)

        $el.on "submit", (event) ->
            submit()

    return {link:link}


module.directive("tgSearchBox", ["lightboxService", "$tgNavUrls", "$tgLocation", "$route", SearchBoxDirective])


#############################################################################
