adding client-side chat.js