adding shutdown hook