fix a bunch of bugs with reconnecting