modify exit function