Added checks if graph instance exists