Added window.onresize event