implement check for duplication