add an optional shutdown function which actions can register