fixed possible null-P-Exception in Preferences