added support for text truncation