fixed problem with window resize