prevent bad sizes in setSize