fix logic min width and height