WIP: better reconnecting