adjust resize-logic