fix maxsize bug