added a string shorten function