add shutdown hook:
add shutdown hooks