Add the function of disconnect.