adds doc validation and fixes errors that result