Assign @exit_program flag in correct method