added a method to destroy stacks