Updated the connection handler.