fix token input bug in which first letters deleted