improved testing of shutdown