working socket.io handler