     pkgs.fetch(reset: true)
 
     new EnvsView({el: $('#envs'), envs: envs})
-    new SearchView({el: $('#search'), envs: envs})
+    new SearchView({el: $('#search'), pkgs: pkgs})
     new PackagesView({el: $('#pkgs'), envs: envs, pkgs: pkgs})
 
     $('#settings').click (event) =>

class SearchView extends Backbone.View
    initialize: (options) ->
        super(options)
        @envs = options.envs
        @listenTo(@envs, 'filter', @on_filter)
        @render()

    events:

        @envs = options.envs
        @pkgs = options.pkgs
        @listenTo(@envs, 'all', () => @render())
        @listenTo(@pkgs, 'all', () => @render())
        @render()

    render: () ->
