Fixed saving bug

Fixed a bug where saving a file, creating a new file, and then saving
again overwrites the original file