Added save controls to shutdown hook