Avoid using a string replace on stack

By ensuring the stack gets built after other stack data is populated