maxVal fix