Added dynamic scale for resizing