Add shutdown code