modified chatserver.js