fixed a wrong min value