This should make disconnecting working properly.