fix error closure