fix a problem of recalculation of preferred size