Fix error in runDocValidation loop