fix ascii write bug