updates asyncPlatformFlush to flush