Improve the new error handling