Resize logic changed