modification function refresh_window and main_window