Add writeError