Fixed window resize problem