find duplicates function plus callback