write file bug