moved socket.emit('join') and socket.on('chat message') to run block of app.js.