removed process.exit, using socket.disconnect to terminate