Trying to fix window resize with pubsub