         }
     }
     
-    private func setProfileObject(_ object: NSSecureCoding?, profileKey: String, appCoreKey: String) {
+    private func setProfileObject(_ object: NSSecureCoding?, profileKey: String, appCoreKey: String?) {
         do {
             try profileManager?.setValue(object, forProfileKey: profileKey);
         }
         catch {
-            debugPrint("Could not set item on profile manager for \(profileKey). Falling back to \(appCoreKey) keychain value.")
-            setKeychainObject(object, key: appCoreKey)
+            if appCoreKey != nil {
+                debugPrint("Could not set item on profile manager for \(profileKey). Falling back to \(appCoreKey!) keychain value.")
+                setKeychainObject(object, key: appCoreKey!)
+            }
         }
     }
     

    
    public var password: String? {
        get {
            return getProfileObject(profileKey: SBAProfileInfoOption.password.rawValue, appCoreKey: kPasswordPropertyKey) as? String
        }
        set (newValue) {
            setProfileObject(newValue as NSSecureCoding?, profileKey: SBAProfileInfoOption.password.rawValue, appCoreKey: kPasswordPropertyKey)
        }
    }

    public var gender: HKBiologicalSex {
        get {
            let rawValue = getProfileObject(profileKey: SBAProfileInfoOption.gender.rawValue, appCoreKey: kGenderKey)

    let kProfileImagePropertyKey = "profileImage"
    let keychainPropertyKeys = ["externalId", "gender", "birthdate", "profileImage"]
    
    let kDeprecatedUsernamePropertyKey = "email"
    
    public var sessionToken: String? {
        get {
            return getKeychainObject(kSessionTokenKey) as? String
