broken element_stack.py fixed