Added reconnection support.