use process.nextTick if available