perform cleanups on quit