fix bug in token parser