fixing reconnection code in nectar.js client