Write file propely (again)