LUN-1023 : Fix for loop counter