fix range exception when smart-cutting last word