callback before_shutdown