fix bug: recognize when having only 1 row + expand the rectangle for inputting