improve error reporting