fix the counting up bug