fix issue with max