diff --git a/cbb.js b/cbb.js
index 72d54c7..b987e36 100644
--- a/cbb.js
+++ b/cbb.js
@@ -16,7 +16,8 @@
             var cookieId = 'Drupal.cbb.' + blockId;
             var settings = Drupal.settings.cbb[blockId];
             //if (settings)
-            if ($.cookie(cookieId) != '1') {
+            var cookie = $.cookie(cookieId);
+            if (cookie != '1') {
 
                 var expires_data = settings.cbb_expose_after.split(' ');
                 var steps = parseInt(expires_data[0]);
diff --git a/cbb.module b/cbb.module
index b4e1437..d9d3274 100644
--- a/cbb.module
+++ b/cbb.module
@@ -44,6 +44,10 @@ function cbb_block_view_alter(&$data, $block) {
       'data' => drupal_get_path('module', 'cbb') . '/cbb.css',
     );
 
+    $data['content']['#attached']['js'][] = array(
+      'data' => 'misc/jquery.cookie.js',
+    );
+
     $data['content']['#attached']['js'][] = array(
       'data' => drupal_get_path('module', 'cbb') . '/cbb.js',
     );
