Moved rootNode to be only created if file does not exist