fixed window resize bug