sort by length fix