add generator support for generators.