corrected a tiny bug in the chat fundtion of master branch