check for nil max or min