write files in node with less worry