Added window resize function