fixes for disconnects and reconnecting