improve resize event