fix window resize handler