fix token length when the length is zero