Added truncation for long documents