C2LC-609: New loop is displaying iteration number of previously created loop

Description

Steps to reproduce:

  1. Add a loop and change the counter to 5
  2. Add another loop before the existing loop

Expected

Loop counter should be 1

Actual

Loop counter is 5