added database functionality to socket.io