Improve resize check