set exit hook optional