             if not (@data.view = @options.view)
                 throw new Error 'view model required'
 
-            @queryView = new @regionViews.queries
+        onRender: ->
+            queryView = new @regionViews.queries
                 editQueryRegion: @editQueryRegion
                 deleteQueryRegion: @deleteQueryRegion
                 collection: @data.queries


        initialize: ->
            @data = {}
            if c.isSupported('2.2.0') and not (@data.public_queries = @options.public_queries)
                throw new Error 'public queries collection required'
            if not (@data.queries = @options.queries)
                throw new Error 'queries collection required'

                view: @data.view
                editable: true

            @queries.show(queryView)

            if c.isSupported('2.2.0')
                publicQueryView = new @regionViews.queries
                    collection: @data.publicQueries
                    context: @data.context
                    view: @data.view
                    title: 'Public Queries'
                    emptyMessage: "There are no public queries. You can create a new, public query by navigating to the 'Results' page and clicking on the 'Save Query...' button. While filling out the query form, you can mark the query as public which will make it visible to all users and cause it to be listed here."

                # When the queries are synced we need to manually update the
                # public queries collection so that any changes to public
                # queries are reflected there. Right now, this is done lazily
