implemented a lazy auto-connect feature