added a max size setting