fix repeat detection