fix for node 0.10: use setImmediate() instead of process.nextTick()