hopefully fixed dead object erros when quiting the application.