added nodesLoaded check to save