fixed shorten function