diff --git a/js_manager.install b/js_manager.install
index 18d534a..f1e478e 100644
--- a/js_manager.install
+++ b/js_manager.install
@@ -73,6 +73,13 @@ function js_manager_schema() {
         'not null' => TRUE,
         'default' => 'header',
       ),
+      'scope_lock' => array(
+        'type' => 'int',
+        'size' => 'tiny',
+        'not null' => TRUE,
+        'default' => 1,
+        'unsigned' => TRUE,
+      ),
       'weight' => array(
         'type' => 'int',
         'not null' => TRUE,
@@ -91,3 +98,18 @@ function js_manager_schema() {
 function js_manager_uninstall() {
   drupal_uninstall_schema('js_manager_add_js');
 }
+
+/**
+ * Adds scope_lock option to JS scripts
+ */
+function js_manager_update_7001() {
+  $table = 'js_manager_add_js';
+  $spec = array(
+    'type' => 'int',
+    'size' => 'tiny',
+    'not null' => TRUE,
+    'default' => 1,
+    'unsigned' => TRUE,
+  );
+  db_add_field($table, 'scope_lock', $spec);
+}
\ No newline at end of file
diff --git a/js_manager.module b/js_manager.module
index 35f9f41..479c2f7 100644
--- a/js_manager.module
+++ b/js_manager.module
@@ -35,6 +35,7 @@ function js_manager_preprocess_page(&$variables) {
       'type' => $item->js_type,
       'scope' => $item->scope,
       'weight' => (int) $item->weight,
+      'scope_lock' => $item->scope_lock ? TRUE: FALSE,
     );
     switch ($item->js_type) {
       case 'external':
diff --git a/plugins/export_ui/js_manager_add_js_ctools_export_ui.inc b/plugins/export_ui/js_manager_add_js_ctools_export_ui.inc
index e2385bb..aabd730 100644
--- a/plugins/export_ui/js_manager_add_js_ctools_export_ui.inc
+++ b/plugins/export_ui/js_manager_add_js_ctools_export_ui.inc
@@ -123,6 +123,12 @@ function js_manager_add_js_ctools_export_ui_form(&$form, &$form_state) {
     '#description' => 'Where the script should be added.',
     '#default_value' => $form_state['item']->scope,
   );
+  $form['scope_lock'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Scope lock'),
+    '#description' => 'Tick this if advagg has the option "force JS to bottom" enabled, locks scripts scope.',
+    '#default_value' => $form_state['item']->scope_lock,
+  );
 }
 
 /**
