fixed file WriteFile