Update Preferences.cs

Update Preferences.cs  which should some errors