added Shutdown function