Fixed issue where wrong attribute was being used for ID