Committing bugfix writing ahead of file in mac