Adding custom error formatting