added wait_for_window condition