Added handling for when all open nodes are exhausted