Fix recursive resize problem