writing to file from node