fix error collection