Improved the chat with functional

Improved the chat with functional