Fixes window resize event handler