diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi
index 5aec4c594..fdf62361d 100644
--- a/html/cgi-bin/index.cgi
+++ b/html/cgi-bin/index.cgi
@@ -457,6 +457,7 @@ END
if (($line =~ /\"$vpnconfig{$key}[1]\".*IPsec SA established/) || ($line =~/$vpnconfig{$key}[1]\{.*INSTALLED/ )){
$activecolor = $Header::colourgreen;
$activestatus = $Lang::tr{'capsopen'};
+ last;
} elsif ($line =~ /$vpnconfig{$key}[1]\[.*CONNECTING/) {
$activecolor = $Header::colourorange;
$activestatus = $Lang::tr{'vpn connecting'};
diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi
index ae5e80d38..db442e111 100644
--- a/html/cgi-bin/vpnmain.cgi
+++ b/html/cgi-bin/vpnmain.cgi
@@ -3019,6 +3019,7 @@ END
($line =~ /$confighash{$key}[1]\{.*INSTALLED/)) {
$col1="bgcolor='${Header::colourgreen}'";
$active = "$Lang::tr{'capsopen'}";
+ last;
} elsif ($line =~ /$confighash{$key}[1]\[.*CONNECTING/) {
$col1="bgcolor='${Header::colourorange}'";
$active = "$Lang::tr{'vpn connecting'}";