Solve writing error