changed chat.js