fix the problem of nullpointer for range and percentage