flatten instance ids and tag them