process.nextTick workaround for browser