diff --git a/themes/blueprint/js/cart.js b/themes/blueprint/js/cart.js
index 59f2ea1d4244e2f1110429bd6c0d23bba5b7c1b9..578cd15d00c6e033406d4a5e884854bba663537c 100644
--- a/themes/blueprint/js/cart.js
+++ b/themes/blueprint/js/cart.js
@@ -1,3 +1,5 @@
+/*global vufindString*/
+
 var _CART_COOKIE = 'vufind_cart';
 var _CART_COOKIE_SOURCES = 'vufind_cart_src';
 var _CART_COOKIE_DELIM = "\t";
@@ -17,9 +19,10 @@ function registerUpdateCart($form) {
                 var msg = "";
                 var orig = getItemsFromCartCookie();
                 $(selected).each(function(i) {
-                    for (i in orig) {
-                        if (this == orig[i]) {
+                    for (var x in orig) {
+                        if (this == orig[x]) {
                             inCart++;
+                            return;
                         }
                     }
                     addItemToCartCookie(this);