Screenshot filename

I have a loop that is taking multiple screenshots until a condition is met. Here is my current code, that appears to be failing, the default working looks to overwrite the screenshot so only one, the latest, is saved → hence the need to add a custom filename. Thoughts?

 {
      "Command": "do",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "loopIndex",
      "Description": "Initialize loop index variable"
    },
    {
      "Command": "captureDesktopScreenshot",
      "Target": "screenshot_${loopIndex}.png",
      "Value": "",
      "Description": "Capture screenshot with loop index"
    },
    {
      "Command": "storeEval",
      "Target": "${loopIndex} + 1",
      "Value": "loopIndex",
      "Description": "Increment loop index"
    },
    {
      "Command": "visualSearch",
      "Target": "x5xhti_dpi_154.png",
      "Value": "endOfANA",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}${KEY_DOWN}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${endOfANA}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "repeatIf",
      "Target": "${endOfANA} >= 0",
      "Value": "",
      "Description": ""
    }