diff --git a/uc_attribute_stock_filter.js b/uc_attribute_stock_filter.js
index b2ca946..9de9cfb 100644
--- a/uc_attribute_stock_filter.js
+++ b/uc_attribute_stock_filter.js
@@ -18,9 +18,15 @@ Drupal.behaviors.ucAttributeStockFilter = function() {
 function onSelectChange() {
   var parentForm = 'form#'+ $(this).parents('form').get(0).id; // Grab id of parent form tag.
   var parentNode = parentForm.substr(parentForm.lastIndexOf('-') + 1);
+  //console.log(parentNode);
+  if (parentNode == '1') { //in case your form id is like uc-product-add-to-cart-form-87-1 -- i'm afraid this logic will break if nid == 1
+    parentNode = parentForm.substr(0, parentForm.lastIndexOf('-'));
+    parentNode = parentNode.substr(parentNode.lastIndexOf('-') + 1);
+    //console.log(parentNode);
+  }
   var parentId = '#'+ $(this).parent().get(0).id; // Grab id of parent of active option
   var selected = $(parentForm +" "+ parentId +" option:selected").val(); // Grab value of selected option
-//  alert(parentId);
+  //console.log(parentId);
 
   if ($.browser.msie) {
     // Restore the select boxes from our backup for IE...
diff --git a/uc_attribute_stock_filter.module b/uc_attribute_stock_filter.module
index 14e8b51..b7d76ee 100644
--- a/uc_attribute_stock_filter.module
+++ b/uc_attribute_stock_filter.module
@@ -1,4 +1,5 @@
 <?php
+// $Id: uc_attribute_stock_filter.module,v 1.1.2.3 2010/03/04 11:31:16 klavs Exp $
 
 /**
  * @file
@@ -16,6 +17,7 @@
 function uc_attribute_stock_filter_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
   switch ($op) {
     case 'view':
+    case 'load': //make it work on views
 
       // Get attribute count for this product
       $attrib = db_fetch_object(db_query("SELECT COUNT(aid) AS count FROM {uc_product_attributes} WHERE nid = %d", $node->nid));
@@ -33,7 +35,7 @@ function uc_attribute_stock_filter_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
             foreach ($combo as $key => $option) { // Grab possible combinations
               foreach ($combo as $avail_key => $avail_opt) {
                 if ($avail_key != $key) {
-                  $available[$option][] = $avail_opt;
+                  $available[$node->nid][$option][] = $avail_opt;
                 }
               }
             }
