diff --git uc_userpoints_product.module uc_userpoints_product.module
index f9d398c..cad5445 100644
--- uc_userpoints_product.module
+++ uc_userpoints_product.module
@@ -60,24 +60,21 @@ function uc_userpoints_product_product_feature() {
 /**
 * Build the userpoints feature form
 */
-function uc_userpoints_product_feature_form($node, $feature) {
+function uc_userpoints_product_feature_form($form_state, $node, $feature) {
 	$points = 0;
+        $tid = NULL;
 
-	$nid = arg(1);
-
-	$res = db_query("SELECT * FROM {uc_userpoints_products} ucup, {uc_product_features} ucpf WHERE ucup.pfid = ucpf.pfid AND ucup.nid = %d",$nid);
+        if($feature) {
+	$res = db_query("SELECT * FROM {uc_userpoints_products} ucup, {uc_product_features} ucpf WHERE ucup.pfid = ucpf.pfid AND ucup.pfid = %d",$feature['pfid']);
 	while ($pf = db_fetch_object($res)) {
 	  $points = $pf->points;
 	  $tid = $pf->tid;
 	}
+        }
 	
 	$category_options = userpoints_get_categories();
 	$category_options[-1] = t('Default '.variable_get(USERPOINTS_TRANS_LCPOINTS, 'Points').' Product Category');
 
-	$form['nid'] = array(
-		'#type' => 'value',
-		'#value' => $nid,
-	);
 	$form['points'] = array(
 		'#type' => 'textfield',
 		'#title' => t('Number of '.variable_get(USERPOINTS_TRANS_LCPOINTS, 'points')),
