updating chat functionality