Added reconnect on connection failure.