fixed exception when cutting empty text