Update chat.js

remove unused code