added wait/retry loop for both attach and connect vpn