Move knownNodes save to a different position so that exit may run more smoothly