fix write data
fix write to file