fix scope issue in graph model