fixing minmax