finish Preference function