prevent crash on quits