fixed the ranges issue