fix textwriter generator