working on chat functionality