Now makes sure the file exists before writing to it.
And creates the file on first run.