moved exit_program to core