Handle quitting better