update index.js for generator