changed error reporting functionality to make it possible to recover from errors