cleanups to on_die event