fix error where xml parsing creates duplicates