use setImmediate to make  async