Added support for duplicated detection.

Change-Id: I32d476b0857fdfdb15a2cdcf345f8ebfd33a19f0