you already have the stack in logDetails later (and it correctly splices the first item), why can't you reuse it?