simplified shutdown hook