fix active_window_index