started working on reconnect. not quite working yet