fix error tracking bug