fix maxSize problem