Change open file to 'write' from 'edit' mode. Overwrites whole file instead of only beginning of file.