add a close method to disconnect the socket.io connection