Fix typo: handle pref change correctly