Fix unsuccessful quit crashing app