seems the loop indices were registered on the frame so I have made this change