minor bug fix about window resize