Added function clearPref() for resetting a preference