updated generator.ts
async generation