fix duplicate insertions