fix file writer