fix error detect