port redone in chat.js