added support for window size changes by busy checking the dimensions of the window