Fixed dynamic resizing problem