fix pref upsert