detect repetition of aggregate var