moved everything to chat.js