I'm not working from this exact code at the moment, but very similar code you provided elsewhere.

There's a problem here where the singularization of sideloadedRelation can cause a problem is sideloadedRelation = address. It chops it to addres.
I'm not sure we can use singularisation and pluralisation on the same string?