fix js bug from duplication ids