Adding window resize function