changed exit hook