# After updating nickname, other users still gets previous nickname from the chat

**URL:** <https://community.sendbird.com/t/after-updating-nickname-other-users-still-gets-previous-nickname-from-the-chat/3257>\
**Category:** Android\
**Tags:** group-channel, chatsdk\
**Created:** [October 21, 2021, 6:57am UTC](https://community.sendbird.com/t/after-updating-nickname-other-users-still-gets-previous-nickname-from-the-chat/3257 "2021-10-21T06:57:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Axay\_Prajapati](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/axay_prajapati/32/1704_2.png) [@Axay\_Prajapati](https://community.sendbird.com/u/Axay_Prajapati)\
**Post date:** [October 21, 2021, 6:57am UTC](https://community.sendbird.com/t/after-updating-nickname-other-users-still-gets-previous-nickname-from-the-chat/3257/1 "2021-10-21T06:57:20Z")

</div>

after setting nicknames in both devices using

```
 SendBird.updateCurrentUserInfo(userNickname, null,
        SendBird.UserInfoUpdateHandler { e ->
            if (e != null) {
                // Error!
                Toast.makeText(
                    activity, "" + e.code + ":" + e.message,
                    Toast.LENGTH_SHORT
                ).show()

                return@UserInfoUpdateHandler
            }
            HawkDB.setUserNickName(userNickname)
        })

```

sending message other user getting previous name only.

 ![Screenshot 2021-10-21 122245](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/1/167d483619480a73dd657dc3d3bb9f57aaffd926.jpeg)  
same happens to another device.

Another strange behavior is when going back and coming again to this page showing correct name but sending message again makes all the other user’s messages nickname to previous one.

Handling message receiving using below codes:

```
SendBird.addChannelHandler(
        CHANNEL_HANDLER_ID,
        object : ChannelHandler() {

            override fun onMessageReceived(baseChannel: BaseChannel, baseMessage: BaseMessage) {
                if (baseChannel.url == channelUrl) {
                    groupChatAdapter.markAllMessagesAsRead()
                    // Add new message to view
                    groupChatAdapter.addFirst(baseMessage)
                }
            }
        })

```

Please help me to resolve this. Thank you.

---

<div class="post-metadata">

**Author:** ![Miyoung\_Han](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/miyoung_han/32/183_2.png) [@Miyoung\_Han](https://community.sendbird.com/u/Miyoung_Han)\
**Post date:** [November 17, 2021, 2:53pm UTC](https://community.sendbird.com/t/after-updating-nickname-other-users-still-gets-previous-nickname-from-the-chat/3257/2 "2021-11-17T14:53:47Z")

</div>

Hi @Axay_Prajapati ,

I could not see anything wrong in your code for calling updateCurrentUserInfo() function.  
Could you check the function HawkDB.setUserNickName(userNickname)?  
Also, could you check the user info to see if the user info was updated correctly via API?

> **[User | Chat Platform API | Sendbird Docs](https://sendbird.com/docs/chat/v3/platform-api/guides/user#2-view-a-user)**
>
> Manage the attibutes and functionalities of the users.

If the user’s nickname was updated successfully, you may check your UI display part.

This article might help you to resolve your issue. Please refer to the following.

> **[How to build in-app chat using Kotlin – Part 1 - Sendbird](https://sendbird.com/developer/tutorials/kotlin-chat-tutorial-part-1)**
>
> Learn how to build a chat app using Kotlin with this step-by-step tutorial. Add chat to your mobile app with the Android Sendbird SDK.

> **[How to build in-app chat using Kotlin – Part 2 - Sendbird](https://sendbird.com/developer/tutorials/kotlin-chat-tutorial-part-2)**
>
> Learn how to build a chat app using Kotlin with this step-by-step tutorial. Add chat to your mobile app with the Android Sendbird SDK.
