             myUserID = YepUserDefaults.userID.value,
             me = userWithUserID(myUserID, inRealm: Realm()) {
 
-                if me.username.isEmpty {
+                let username = me.username
+
+                if username.isEmpty {
 
                     YepAlert.textInput(title: NSLocalizedString("Create a username", comment: ""), message: NSLocalizedString("In order to share your profile, create a unique username first.", comment: ""), placeholder: "letters", oldText: nil, confirmTitle: NSLocalizedString("Create", comment: ""), cancelTitle: NSLocalizedString("Cancel", comment: ""), inViewController: self, withConfirmAction: { text in
 
-                        let username = text
-
-                        updateMyselfWithInfo(["username": username], failureHandler: { [weak self] reason, errorMessage in
+                        let newUsername = text
+
+                        updateMyselfWithInfo(["username": newUsername], failureHandler: { [weak self] reason, errorMessage in
                             defaultFailureHandler(reason, errorMessage)
 
                             YepAlert.alertSorry(message: errorMessage ?? NSLocalizedString("Create username failed!", comment: ""), inViewController: self)


                    }, cancelAction: {
                    })
                }
        }
    }

                                    myUserID = YepUserDefaults.userID.value,
                                    me = userWithUserID(myUserID, inRealm: realm) {
                                        realm.write {
                                            me.username = newUsername
                                        }
                                }
                            }
