fix randint calculation