fix hook exit