why is this being generated outside of the conditional? Wouldn't it be more performant to only run this if the `errors` object exists?