diff --git a/modal_forms.module b/modal_forms.module
index b198cb3..9f6c17e 100644
--- a/modal_forms.module
+++ b/modal_forms.module
@@ -9,20 +9,7 @@
  * Implements hook_init().
  */
 function modal_forms_init() {
-  // These function calls must be made in this order.
-  // If not the modal js code will not be loaded correctly.
   _modal_forms_doheader();
-
-  // Include the CTools tools that we need.
-  ctools_include('ajax');
-  ctools_include('modal');
-
-  // Add CTools' javascript to the page.
-  ctools_modal_add_js();
-
-  // Add modal_forms own js and CSS.
-  ctools_add_css('modal_forms_popup', 'modal_forms');
-  ctools_add_js('modal_forms_popup', 'modal_forms');
 }
 
 /**
@@ -143,6 +130,9 @@ function _modal_forms_active() {
 function _modal_forms_doheader() {
   static $already_added = FALSE;
 
+  // These function calls must be made in this order.
+  // If not the modal js code will not be loaded correctly.
+
   // Don't add the JavaScript and CSS multiple times.
   if ($already_added) {
     return;
@@ -225,4 +215,16 @@ function _modal_forms_doheader() {
   }
 
   $already_added = TRUE;
+
+  // Include the CTools tools that we need.
+  ctools_include('ajax');
+  ctools_include('modal');
+
+  // Add CTools' javascript to the page.
+  ctools_modal_add_js();
+
+  // Add modal_forms own js and CSS.
+  ctools_add_css('modal_forms_popup', 'modal_forms');
+  ctools_add_js('modal_forms_popup', 'modal_forms');
+
 }
