Bug fix: crash when clicking "Connect" button.