fix NaN bug that occurred when min=max