Added disconnect before reconnect.