only destroy the stack if we need to