consider if the current graph is saved or not before opening another