fix on the window size changing functionality