Fix error chat.js