corrected bug to read userDefaults