Updated handling of quitting