add shutdown hook, currently it works only after all services have started