fixing unusal crash after failed connect attempt