 
         # Callback that will be registered: updates the toolbar buttons based on how many namespaces have been selected
         update_toolbar_buttons: =>
-            # We need to check how many namespaces have been checked off to decide which buttons to enable/disable
-            $remove_namespaces_button = @.$('.btn.remove-namespace')
-            if @get_selected_namespaces().length < 1
-                $remove_namespaces_button.prop 'disabled', 'disabled'
-            else
-                $remove_namespaces_button.removeProp 'disabled'
-
+            @.$('.btn.remove-namespace').prop 'disabled', @get_selected_namespaces().length < 1
 
         destroy: =>
-             super()
+            super
+            datacenters.off 'all', @update_button_create_namespace
+            databases.off 'all', @update_button_create_namespace
+            @add_database_dialog.destroy()
+            @add_namespace_dialog.destroy()
+            @remove_namespace_dialog.destroy()
 
     class @DatabaseListElement extends UIComponents.CollapsibleListElement
         template: Handlebars.compile $('#database_list_element-template').html()

            namespace_list_element.on 'selected', => callback() for callback in @callbacks

        destroy: =>
             super()


    # Namespace list element
    class @NamespaceListElement extends UIComponents.CheckboxListElement


        register_namespace_callback: (callbacks) =>
            @callbacks = callbacks
            @namespace_list.register_namespace_callbacks @callbacks

        rename_datacenter: (event) ->
            event.preventDefault()
            rename_modal = new UIComponents.RenameItemModal @model.get('id'), 'datacenter'
            rename_modal.render()

        destroy: =>
            @model.off 'change', @render_summary
            @namespace_list.off 'size_changed', @nl_size_changed
            @namespace_list.destroy()

    # Show a list of namespaces
    class @NamespaceList extends UIComponents.AbstractList
