fix chaining in node.js