fix error with same tag multiple times