tune up of the reconnect code