Added (an unnecessary) check for duplicate IDs