fixing writing error