fix a writing file bug