Fix problem with scope in node.js