Exiting correctly