Changed how the shutdown sequence was captured