fixed Write and Append