fix error marking bug