synchronous for loop (node.js)