fix bug with resizing