updated for window resize