fix error paths