Needed to move debug stack and prefix outside of the function, to
prevent the stack from being redeclared each run.