Update shutdown logic.