Updated for chat API change