shutdownhooks improved