adding function and log  for truncate word end boundry