change repetition check logic