resizing logic update