be more consistent with error handling