fix for duplicated ids