Added case for window resize