fix dynamic resizing