fix typo: writeffile -> writefile