Fix bug with autoconnect