diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 4a6609eb238487b505188020f2cffea14e61a84e..b47d9cf73cdc55c2cdacad16f98dc713571cc770 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -1461,7 +1461,7 @@ class remoting {
 
 		if($params['parent_client_id']) {
 			// check if this one is reseller
-			$check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($client_id));
+			$check = $app->db->queryOneRecord('SELECT `limit_client` FROM `client` WHERE `client_id` = ' . intval($params['parent_client_id']));
 			if($check['limit_client'] == 0) {
 				$this->server->fault('Invalid reseller', 'Selected client is not a reseller.');
 				return false;