fix bug: duplicate ids created