added custom exception, error and shutdown handlers