Added exit function.