fix write file test