Added extra document logic