diff --git a/interface/lib/classes/remote.d/dns.inc.php b/interface/lib/classes/remote.d/dns.inc.php
index c9a5031f0e9a877edc4f9b2dad7a5b77db06c226..d1bdfc79954b231adcd153fb985ae35f315fc031 100644
--- a/interface/lib/classes/remote.d/dns.inc.php
+++ b/interface/lib/classes/remote.d/dns.inc.php
@@ -218,10 +218,11 @@ class remoting_dns extends remoting {
 		if(!$this->checkPerm($session_id, 'dns_' . $rr_type . '_add')) {
 			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
 		}
+		$primary_id = $this->insertQuery('../dns/form/dns_' . $rr_type . '.tform.php', $client_id, $params);
 		if($update_serial) {
 			$this->increase_serial($session_id, $client_id, $params);
 		}
-		return $this->insertQuery('../dns/form/dns_' . $rr_type . '.tform.php', $client_id, $params);
+		return $primary_id;
 	}
 
 	//* Update a record