fixes a bug that prevents to get the max/min value when the max percentage is 100 or the min is 0