improve term resizing