Socket.io - working. but needs to be improved