diff --git a/interface/web/client/domain_del.php b/interface/web/client/domain_del.php
index 9a02ac95785db5ccb8d88fabf7823a7d6d0a2257..6bc07e60ddebfd823adf6933e4bc8d113bcc97ff 100644
--- a/interface/web/client/domain_del.php
+++ b/interface/web/client/domain_del.php
@@ -80,7 +80,7 @@ class page_action extends tform_actions {
 			$app->error($wb['error_domain_in mailuse']);
 		}
 
-		$sql = "SELECT domain_id FROM web_domain WHERE domain = '" . $app->db->quote($domain) . "'";
+		$sql = "SELECT domain_id FROM web_domain WHERE (domain = '" . $app->db->quote($domain) . "' AND type IN ('alias', 'vhost', 'vhostalias')) OR (domain LIKE '%." . $app->db->quote($domain) . "' AND type IN ('subdomain', 'vhostsubdomain'))";
 		$res = $app->db->queryOneRecord($sql);
 		if (is_array($res)){
 			$app->error($wb['error_domain_in webuse']);
diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php
index 221e8a2079e445e269a0677f7ec39817b820e87b..cda557c6e524728526d0cf640e4f81fa9e6ba584 100644
--- a/interface/web/client/domain_edit.php
+++ b/interface/web/client/domain_edit.php
@@ -89,7 +89,7 @@ class page_action extends tform_actions {
 			if(is_array($clients)) {
 				foreach( $clients as $client) {
 					$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
-					$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
+					$client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n";
 				}
 			}
 			$app->tpl->setVar("client_group_id", $client_select);