add support for generators