add a exit prompt function