fix file write
fix file write