Save pref only if it's different from the old pref