working duplication check