change $exit_flag to @exit_flag