add reconnect handling