Added shutdown hook to the program