Duplicate reference check fixed