finished chat functionality