fix graph initialization bug