Added support for window resize