update documentation and add assertion check for Stack to destructor