writeToLocalFile