fix issue in save_pref