Exit handler fix