add validation upon doc generation