fix the strange behavior of lexical analyzer