replaced failure with exceptions