deal with exceptions in shutdown events