Added setTimeout to window resize function