fix reconnect handling