bug fix at range index