write history fix