added exception in find_dups function