adding some more defensive code incase of scigraph issues