Added window resize event handler