better reconnection management