Added wait method to window class.