fix range limit computation