shutdown code updates