working chat functionality done