potentially fixed crash-on-quit due to quit() being called twice