working on error reporting