Added window resize event
Added WaitEvent