Revert "remove duplicate checking code"
Revert "remove duplicate checking code"

This reverts commit ab4d46a5357deb3a12e20c247b99d6f8d99e1f72.

tjcsl/director,tjcsl/director,tjcsl/director,tjcsl/director