fix reading too far in lexer