implement smart change size