diff --git a/lazy-connect b/lazy-connect
index 34abb7e..7ff7429 100755
--- a/lazy-connect
+++ b/lazy-connect
@@ -95,7 +95,7 @@ function _lazy_connect_get_totp() {
 
 function _lazy_connect() {
   vpn_name=$1
-  osx_vpn_name="${vpn_name/Connect /}, Not Connected"
+  osx_vpn_name="${vpn_name/Connect /}"
 
   _lazy_connect_get_totp $2
   local autofill=$3
@@ -126,7 +126,7 @@ function _lazy_connect() {
                 tell window 1
                     repeat with r in rows of table 1 of scroll area 1
 
-                        if (value of attribute "AXValue" of static text 1 of r as string) is equal to "$osx_vpn_name" then
+                        if (value of attribute "AXValue" of static text 1 of r as string) contains "$osx_vpn_name" then
                             select r
                         end if
                     end repeat
@@ -145,7 +145,9 @@ function _lazy_connect() {
 
             delay 1
                     tell group 1
-                        click button "Connect"
+                        if button "Connect" exists then
+                            click button "Connect"
+                        end if
             end tell
 
                 end tell