Added a shutdown listener.