Fixes window resize issue