changed to minsize and maxsize