add append to file function