Changed from window resize to the use of interval to track window size changes