Moved the errors check to a helper, no longer needed here