Add process exit function