hook on stop run to be able to graceful shutdown xg