fixes document visualization bug