You should use writeProperty here instead of writing directly to the file. writeProperty will check the default value and not write to a file if the value you pass is equal to default value. Can you fix it?