partial implementation of window resize