Fixed crash after pressing a key after unsuccesful connection