updates to get some of the shutdown code to execute via Program