fix the repeat number bug