change type of maxValue and minValue to double