Improve reconnect handling