fixed exit hook