diff --git a/IPython/html/static/notebook/js/main.js b/IPython/html/static/notebook/js/main.js
index 45b039e..065117f 100644
--- a/IPython/html/static/notebook/js/main.js
+++ b/IPython/html/static/notebook/js/main.js
@@ -18,6 +18,7 @@ require([
     'notebook/js/savewidget',
     'notebook/js/keyboardmanager',
     'notebook/js/config',
+    'custom/custom',
 ], function(
     IPython, 
     $,
@@ -113,11 +114,8 @@ require([
         // only do this once
         events.off('notebook_loaded.Notebook', first_load);
     };
-    
     events.on('notebook_loaded.Notebook', first_load);
-    events.trigger('app_initialized.NotebookApp');
-    notebook.load_notebook(common_options.notebook_name, common_options.notebook_path);
-
+    
     IPython.page = page;
     IPython.layout_manager = layout_manager;
     IPython.notebook = notebook;
@@ -132,4 +130,8 @@ require([
     IPython.save_widget = save_widget;
     IPython.config = user_config;
     IPython.tooltip = notebook.tooltip;
+
+    events.trigger('app_initialized.NotebookApp');
+    notebook.load_notebook(common_options.notebook_name, common_options.notebook_path);
+
 });
diff --git a/IPython/html/static/tree/js/main.js b/IPython/html/static/tree/js/main.js
index c4d35f8..a3e0b36 100644
--- a/IPython/html/static/tree/js/main.js
+++ b/IPython/html/static/tree/js/main.js
@@ -14,6 +14,7 @@ require([
     'auth/js/loginwidget',
     'jqueryui',
     'bootstrap',
+    'custom/custom',
 ], function(
     IPython, 
     $, 
@@ -90,6 +91,16 @@ require([
     enable_autorefresh();
 
     page.show();
+
+    // For backwards compatability.
+    IPython.page = page;
+    IPython.notebook_list = notebook_list;
+    IPython.cluster_list = cluster_list;
+    IPython.session_list = session_list;
+    IPython.kernel_list = kernel_list;
+    IPython.login_widget = login_widget;
+    IPython.events = events;
+
     events.trigger('app_initialized.DashboardApp');
     
     // bound the upload method to the on change of the file select list
@@ -107,12 +118,4 @@ require([
         $("#tabs").find("a[href=" + window.location.hash + "]").click();
     }
 
-    // For backwards compatability.
-    IPython.page = page;
-    IPython.notebook_list = notebook_list;
-    IPython.cluster_list = cluster_list;
-    IPython.session_list = session_list;
-    IPython.kernel_list = kernel_list;
-    IPython.login_widget = login_widget;
-    IPython.events = events;
 });