started exit function