use process.nextTick to invoke waiting callbacks