exit function added