Fixed write error