# Weird loop behaviour

**URL:** https://community.mp3tag.de/t/weird-loop-behaviour/16564
**Category:** Web Sources Discussion
**Created:** [February 3, 2015, 7:39pm UTC](https://community.mp3tag.de/t/weird-loop-behaviour/16564 "2015-02-03T19:39:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![freak](https://community.mp3tag.de/user_avatar/community.mp3tag.de/freak/32/5363_2.png) [@freak](https://community.mp3tag.de/u/freak)
#### Post date: [February 3, 2015, 7:39pm UTC](https://community.mp3tag.de/t/weird-loop-behaviour/16564/1 "2015-02-03T19:39:03Z")

</div>

I have a problem modifying the Discogs script, maybe someone has a solution for this:

if I add into the trackloop another loop for credits (extraartists), similar to the one for "Artists", the loop for the current track brakes and I get weird results, like the album title instead of the track title.

The added loop looks like this:

```
json_foreach "tracklist"
    json_select "type_"
    if "track"
        #CREDITS
        outputto "Credits"
        json_select_many "extraartists" "name" "; "
        ifnot ""
            json_foreach "extraartists"
                DO_SOME_STUFF (like say "xxx")
            json_foreach_end
        endif
        say "|"

        #TRACKS
        ...
        #ARTIST
        ...
    endif
json_foreach_end

```

Like they can't be 2 json\_foreach loops at the same time inside the track loop. If I comment out the entire "Artist" loop then the "Credits" loop works. As a workaround I created an entire new trackloop at the end which is a bit ugly but it works.  
Anyone has an idea?
