Add a shutdown hook for when everything is done