Please update these two lines to not repeat the same value again but extend the value like this:

    set(foo "[${foo}, newstuff])