Add max stack size for the undo manager