hasRepeat Function fixed