add function to rebuild scanned docs