fixed a bug in chat.