better transparency; try not to crash on empty documents