tocsc() cannot be called in generator