swap out process.nextTick for setImmediate for recursive call