made some changes to index.js and added an origin assigned check in
socket.js