added auto reconnect.