Added formatFailure method