add some logic for chat, not completed