Bugfix for window resize