Update handling of shutdown procedure