added a shutdown hook to unregister a node when it goes down