add write_error