fix for duplicate id bug