emergency exit function.