fixing window resize for index