fixes bug that prevented generator from completing