add lexer buffer object
fix minor bugs