remove connection corectly on CLOSE in node.js