Changed writing of the file