Fix resize problem