Adding in reconnection code.