fix filewriter