add test for shutdown function