Fixed repeat count issue