add the funcation of chat