fixing the connection crash