validating documents