Right position of setImmediate