covert some of the die calls to calls to _error