fixed bug with duplicated numbers