Adding fix for duplicate nodes