Fixing window resize bug.