recursive reconnect code
recursive reconnect code