add the exit_flag