fix bug on minsize condition