generate graph code fix