Fix auto resize problem