document validation