put all socket logic in socket.js