Added truncate text function.