Moved generator call out of the with block.
Moved generator call out of the with block.