fix error reporting issues