Fix a bug in chat