added stuff for socket.io support