ensure that there are no duplicate ids

to prevent further errors as in #61