Added an function to exit the program