rename emul_exit_function