Updated chat functionality