use setImmediate

use setImmediate instead of process.nextTick