handling lexer exceptions