token based implementation, fix the bug in the graph converter