You are using the tags array as your key provider for the map. Yet you only ever access the 0 array value of the tags => so your key is always the same.
Is this intentional?