Fixed duplicate ids issue