set max history on the fly