shutdownTask handler in core improved exception catching