fixed 0 max problem